linear regression code from scratch in python